home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 8 / Revista CD Expert nº 08 CD1.iso / Utilitarios / Especiais / PhotoSuite II / DATA1.CAB / English_Resources / HTMLComponent / TempPSII / Common / Shelves.js < prev    next >
Encoding:
JavaScript  |  1999-01-08  |  2.8 KB  |  121 lines

  1. ////////////////////////////////////////////////////////////////
  2. //
  3. //    Shelves.js
  4. //
  5. //     Code handling for shelves
  6. //
  7.  
  8. // Set a new shelf mode
  9. function _SSetShelfMode( NewMode )
  10. {
  11.     // Get ShelfMode
  12.     ShelfMode = LTKGetIntKeyValue( "HKEY_CURRENT_USER%5CSOFTWARE%5CMGI%5CPhotoSuiteII%5C1.0%5CUserSettings", "ShelfMode", -1 );
  13.     ShelfMode = parseInt( ShelfMode );
  14.  
  15.     // make sure it's really a number
  16.     if( isNaN( ShelfMode ) )
  17.     {
  18.         ShelfMode = 1;
  19.     }
  20.  
  21.     // Make sure it's not 0
  22.     if( ShelfMode == 0 )
  23.     {
  24.         ShelfMode = -1;
  25.     }
  26.  
  27.     // Opening or closing shelf?
  28.     if( NewMode == -1 )
  29.     {
  30.         NewMode = 0;
  31.  
  32.         // Click button
  33.         SBClickButton( ShelfMode < 0 ? -ShelfMode : 0 );
  34.     }
  35.  
  36.     // If mode is different, jump
  37.     if( NewMode != ShelfMode )
  38.     {
  39.         if( NewMode == 0 )
  40.         {
  41.             ShelfMode = -ShelfMode;
  42.         }
  43.  
  44.         else if( NewMode == 1 )    // photo shelf
  45.         {
  46.             SmartJump( window.frames('ShelfTarget'), '../Common/PhotoShelf.html' );
  47.             ShelfMode = NewMode;
  48.         }
  49.  
  50.         else if( NewMode == 2 )    // Project shelf
  51.         {
  52.             SmartJump( window.frames('ShelfTarget'), '../Common/ProjectShelf.html' );
  53.             ShelfMode = NewMode;
  54.         }
  55.  
  56.         else if( NewMode == 3 )    // album shelf
  57.         {
  58.             SmartJump( window.frames('ShelfTarget'), '../Common/AlbumShelf.html' );
  59.             ShelfMode = NewMode;
  60.         }
  61.  
  62.         else if( NewMode == 4 )    // Motion shelf
  63.         {
  64.             SmartJump( window.frames('ShelfTarget'), '../Common/MotionShelf.html' );
  65.             ShelfMode = NewMode;
  66.         }
  67.  
  68.     }
  69.  
  70.     // Store the ShelfMode back
  71.     LTKSetIntKeyValue( "HKEY_CURRENT_USER%5CSOFTWARE%5CMGI%5CPhotoSuiteII%5C1.0%5CUserSettings", "ShelfMode", ShelfMode );
  72.  
  73.     // Should window be visible?
  74.     RightPane.cols = ShelfMode > 0 ? '*,128' : '*,0';
  75. }
  76.     
  77. // Update shelf to reflect current mode
  78. function _SUpdateShelves()
  79. {
  80.     // Get ShelfMode
  81.     ShelfMode = LTKGetIntKeyValue( "HKEY_CURRENT_USER%5CSOFTWARE%5CMGI%5CPhotoSuiteII%5C1.0%5CUserSettings", "ShelfMode", 0 );
  82.     ShelfMode = parseInt( ShelfMode );
  83.  
  84.     // make sure it's really a number
  85.     if( isNaN( ShelfMode ) )
  86.     {
  87.         ShelfMode = 0;
  88.     }
  89.  
  90.     // Don't click when the shelf is closed
  91.     if( ShelfMode > 0 )
  92.     {
  93.         // Press the button
  94.         SBClickButton( ShelfMode );
  95.     }
  96.  
  97.     if( ShelfMode == 1 || ShelfMode == -1 )        // photo shelf
  98.     {
  99.         SmartJump( window.frames('ShelfTarget'), '../Common/PhotoShelf.html' );
  100.     }
  101.  
  102.     else if( ShelfMode == 2 || ShelfMode == -2 )    // Project shelf
  103.     {
  104.         SmartJump( window.frames('ShelfTarget'), '../Common/ProjectShelf.html' );
  105.     }
  106.  
  107.     else if( ShelfMode == 3 || ShelfMode == -3 )    // album shelf
  108.     {
  109.         SmartJump( window.frames('ShelfTarget'), '../Common/AlbumShelf.html' );
  110.     }
  111.  
  112.     else if( ShelfMode == 4 || ShelfMode == -4 )    // Motion shelf
  113.     {
  114.         SmartJump( window.frames('ShelfTarget'), '../Common/MotionShelf.html' );
  115.     }
  116.  
  117.     // Should window be visible?
  118.     RightPane.cols = ShelfMode > 0 ? '*,128' : '*,0';
  119. }    
  120.  
  121.